-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Fix IntegerArray pow for special cases #30210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix IntegerArray pow for special cases #30210
Conversation
When dividing by 0, the result should be `inf`, not `NaN`. Closes pandas-dev#27398
x^0 == 1 1^x == 1
FYI @jorisvandenbossche this is slightly blocking #29964. It'll make the changes there more focused. |
mask = np.where(other == 1, False, mask) | ||
# 1 ** x is 1. | ||
if omask is not None: | ||
mask = np.where((other == 1) & ~omask, False, mask) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't this check for self._data == 1
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, no, because it is for the reversed op? (maybe add a comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your call on whether a comment is needed. It's clear IMO, though I wrote it :)
Co-Authored-By: Joris Van den Bossche <[email protected]>
…r/pandas into integer-array-pow-2
@jorisvandenbossche good to go here? |
x^0 == 1 1^x == 1
x^0 == 1 1^x == 1
Split from #29964
Only 9e5a69c is relevant. The rest is #30183, but pushing this up now.